package com.qst.crop.dao;

import com.qst.crop.entity.Finance;
import com.qst.crop.entity.FinanceDetail;
import com.qst.crop.entity.Intention;
import com.qst.crop.entity.RecommendVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FinanceDao {

    @Insert("insert into tb_finance(bank_id, own_name, real_name, phone, id_num, status, remark, money, rate, repayment, create_time, update_time, file_info)" +
            " VALUES (#{bankId}, #{ownName}, #{realName}, #{phone}, #{idNum}, #{status},#{remark},#{money}, #{rate},#{repayment},#{createTime},#{updateTime},#{fileInfo})")
    void addPersonal(Finance finance);

    @Insert("insert into tb_finance(bank_id, own_name, real_name, phone, id_num, status, remark, money, rate, repayment, create_time, update_time, combination_name1, combination_phone1, combination_idnum1, combination_name2, combination_phone2, combination_idnum2, file_info)" +
            " VALUES (#{bankId}, #{ownName}, #{realName}, #{phone}, #{idNum}, #{status},#{remark},#{money}, #{rate},#{repayment},#{createTime},#{updateTime},#{combinationName1},#{combinationPhone1},#{combinationIdnum1},#{combinationName2},#{combinationPhone2},#{combinationIdnum2},#{fileInfo})")
    void addMulti(Finance finance);


    List<Finance> selectByName(String userName);

    @Select("select * from tb_finance where finance_id=#{id}")
    Finance selectById(Integer id);

    @Delete("delete from tb_finance where finance_id=#{id}")
    void deleteById(Integer id);

    void updateById(Finance finance);

    FinanceDetail selectFinaceUser(String username,Integer bankId);


    FinanceDetail showBank(Integer bankId);

    List<RecommendVO> selectRecommend(@Param("nameList")String[] nameList);


    Intention selectIntention(String name);

    List<Integer> getAllBid(String username);
}
